﻿package  
{
	import com.ixiyou.utils.keyboard.HotKey;
	import com.ixiyou.utils.keyboard.KeyStroke;
	import flash.display.Sprite;
	
	/**
	 * HotKey测试
	 * @author magic
	 */
	public class Keytest extends Sprite
	{
		
		public function Keytest() 
		{
			var hk:HotKey = new HotKey(stage);
			hk.registerKeys(function():void { trace("AK") }, [KeyStroke.VK_A, 70]);
			hk.registerKeys(function():void { trace("a&&K") }, KeyStroke.VK_A, 70);
			hk.registerLongKeys(function():void { trace("d__0.5") }, 500, KeyStroke.VK_D);
			hk.registerLinkKeys(function():void { trace("a_S_D") }, 1000, KeyStroke.VK_A, KeyStroke.VK_S, KeyStroke.VK_D);
			hk.registerLinkKeys(function():void { trace("D_D_D") }, 500, KeyStroke.VK_D, KeyStroke.VK_D, KeyStroke.VK_D);
			hk.registerKeys(testAK, KeyStroke.VK_A, KeyStroke.VK_K);
			hk.removeKeys(testAK, KeyStroke.VK_A, KeyStroke.VK_K);
		}
		
		private function testAK():void {
			trace("ak");
		}
	}
	
}